#define DEBUG
#include <cstdio>
#include <cstdlib>
#include <ctime>

using namespace std;

void makeData(int n, int maxa) {
  FILE *f = fopen("2.in", "w");
  fprintf(f, "%d %d\n", n, rand()%(maxa+1));
  for (int i=1; i<=n; i++) {
    fprintf(f, "%d ", rand()%(maxa+1));
  }
  fclose(f);
}

int main() {
  srand(time(0));

  int n, maxa, maxt;
  scanf("%d %d %d", &n, &maxa, &maxt);

  for (int i=1; i<=maxt; i++) {
    makeData(n, maxa);
    if (system("./2")) {
      printf("RE\n");
      return -1;
    }
    if (system("./checker")) {
      printf("Checker Error.\n");
      return -1;
    }
    if (system("cmp 2.out 2_checker.out")) {
      printf("WA\n");
      return -1;
    }
  }

  return 0;
}
